#pragma once
#include <winsock2.h>
#include <map>

namespace vrts
{
    class SocketTCP
    {
        public:
            SocketTCP();
            ~SocketTCP();

            bool Bind(unsigned short port, char * hostIp);
            SOCKET Accept();
            int Connect(unsigned short port, char * hostIp);

            int SendData(char * buf, int bufLen);
            int ReceiveData(char *buf, int &bufLen);

        private:
            static bool m_socketInited;
            SOCKET m_socket = 0;
            std::map<SOCKET, sockaddr_in> m_clients;

    };
}